﻿namespace ImapComponent.Net.Mail.Mime
{
    using System.Net.Mime;

    /// <summary>
    /// Represents the mime attachment part.
    /// </summary>
    public class MimeAttachment : MimePart
    {
        #region Fields

        private readonly string name;
        private readonly ContentDisposition contentDisposition;

        #endregion // Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the MimeAttachment class.
        /// </summary>
        /// <param name="parent">a mime part parent.</param>
        /// <param name="contentData">A data content.</param>
        /// <param name="contentType">A content type.</param>
        /// <param name="contentId">A content id.</param>
        /// <param name="transferEncoding">A transfer encoding.</param>
        /// <param name="name">A name of the mime attachment.</param>
        /// <param name="nameEncoding">A encoding of the name.</param>
        /// <param name="contentDisposition">A content disposition.</param>
        public MimeAttachment(MimePart parent, byte[] contentData, ContentType contentType, string contentId, TransferEncoding transferEncoding, string name, ContentDisposition contentDisposition)
            : base(parent, contentData, contentType, contentId, transferEncoding)
        {
            this.name = name;
            this.contentDisposition = contentDisposition;
        }

        #endregion // Constructors

        #region Properties

        /// <summary>
        /// Gets the name of the mime attachment.
        /// </summary>
        public string Name
        {
            get
            {
                return this.name;
            }
        }

        /// <summary>
        /// Gets the content disposition of the mime attachment.
        /// </summary>
        public ContentDisposition ContentDisposition
        {
            get
            {
                return this.contentDisposition;
            }
        }

        #endregion // Properties
    }
}
